import cv2 as cv

img = cv.imread("assets/cb.jpg")
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
dst = cv.cornerHarris(gray, 10, 17, 0.06)
#print(dst.max())
#img[dst>0.001*dst.max()] = [0, 0, 225]
#cv.imshow("img-harris", img)

fast=cv.FastFeatureDetector_create(
    threshold=20,
    nonmaxSuppression=True,
    type=cv.FAST_FEATURE_DETECTOR_TYPE_9_16)#获取FAST角点探测器
kp=fast.detect(img, None)

cv.drawKeypoints(img, kp, img, color=(255,0,0))
print ("特征点个数: ", len(kp))

cv.imshow('img-fast',img)
cv.waitKey(0)